home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / thor / thor_2.4 / installthor < prev    next >
Text File  |  1996-11-11  |  43KB  |  1,582 lines

  1. ; $Id: InstallThor 1.4 1996/11/06 19:13:57 pettern Exp pettern $
  2. ;*************************************************************************
  3. ;    Title:
  4. ;        InstallThor
  5. ;*************************************************************************
  6. ;    Description:
  7. ;        Commodore Installer Script for the Thor 2.4 software
  8. ;*************************************************************************
  9. ;    Author:
  10. ;        Øyvind Ellefsen - versions for THOR upto 1.22
  11. ;       Petter Nilsen   - versions for 1.25 ->
  12. ;          - parts borrowed from the Demon ISP installer for THOR 2.3
  13. ;            created by Neil Bothwick <neil@wirenet.u-net.com>
  14. ;          - intro borrowed from Robert Reiswig's CyberGfx installer
  15. ;*************************************************************************
  16. ;    Still to do:
  17. ;        - Show .readme file
  18. ;        - Warn against MultiUser
  19. ;       - Make sure all dirs are present before copying files
  20. ;
  21. ;*************************************************************************
  22. ;
  23. ;******************************************************
  24. ;***** SET UP OUR VARIABLES AND OTHER SUCH STUFF ******
  25. ;******************************************************
  26.  
  27. ; some useful variables
  28.     (set 
  29.         true             1
  30.         false             0
  31.         yes             true
  32.         no                 false
  33.         is_a_file         1
  34.         is_a_dir         2
  35.         quote             "\""
  36.         newline         "\n"
  37.         tick             "'"
  38.         nothing         ""
  39.         dldirproblem    0
  40.         bbspack         0
  41.         inetpack         0
  42.         #inetpackname     "thor24_inet.lha"
  43.         #bbspackname     "thor24_bbs.lha"
  44.         #arexxpackname     "thor24_arexx.lha"
  45.         classact         0
  46.         tcptype         0
  47.         uucptype         0
  48.         cpu             (database "cpu")
  49.         cpu020             (and (<> cpu "68000") (<> cpu "68010"))
  50.         v39             (>= (/ (getversion "exec.library" (resident)) 65536) 39)
  51.  
  52.         #installtext    (cat "This section of the installation is dedicated "
  53.                             "to some first-time parameters that THOR "
  54.                             "needs to have configured.\n\n"
  55.                             "Select YES if you want to continue with this "
  56.                             "configuration, otherwise NO")
  57.  
  58.         #endtcpcfgtext    (cat "After this installation is complete, start THOR "
  59.                             "and then select ConnectTHOR from the External menu.\n"
  60.                             "Press SendEvents in the ConnectTHOR window and "
  61.                             "a list of newsgroups will be collected (this will take a while).\n"
  62.                             "Afterwards, you can enter you Internet system in THOR and select "
  63.                             "Join from the Events menu to subscribe (Join) newsgroups.\n" 
  64.                             "Another SendEvents in ConnectTHOR will make sure you are subscribed "
  65.                             "to these groups.")
  66.  
  67.         #exedtbug (cat "exe.datatype is installed on this machine. This datatype has a bug "
  68.                         "that might caused problems in the datatype filetype recognition "
  69.                         "in THOR on attached files.\nWe recommend that it is removed.\n\n"
  70.                         "Would you like to delete it now?")
  71.     )
  72.  
  73. ; some useful procedures
  74.     ; change userlevel to expert
  75.     (procedure expert_level
  76.         (
  77.             (user 2)
  78.         )
  79.     )
  80.  
  81. ; reset userlevel back to default
  82.     (procedure default_level
  83.         (
  84.             (user default-level)
  85.         )
  86.     )
  87.  
  88. ; store off userlevel
  89.     (procedure save_default_level
  90.         (
  91.             (set default-level @user-level)
  92.         )
  93.     )
  94.  
  95. ; some overused strings
  96. (set #omp (cat "One moment please..." newline))
  97.  
  98. (set #classact "\n\n\nThe following is the default Install/Update Installer\n\nProcedure for placing ClassAct on your System.")
  99.  
  100. ;********************************************************************
  101. ; ClassAct Install/Update Default Procedure by:
  102. ; Osma Ahvenlampi - Osma.Ahvenlampi@hut.fi
  103. ;********************************************************************
  104. ; $VER: ClassAct_Install 1.8 (12.10.96) by Osma Ahvenlampi
  105.  
  106. (set cpu (database "cpu"))
  107. (set cpu020 (and (<> cpu "68000") (<> cpu "68010")))
  108. (set v39 (>= (/ (getversion "exec.library" (resident)) 65536) 39))
  109.  
  110. ; percentage of the size of included ClassAct classes versus the whole
  111. ; distribution (ie. total "complete" percentage after ClassAct is installed)
  112. (set classact-complete 50)
  113.  
  114. (set #classdest-prompt "Please select the directory where you want the ClassAct classes installed.\n(See help for details)")
  115. (set #classdest-help (cat "ClassAct is a GUI toolkit consisting of shared BOOPSI classes.\n\nSome programs require some or all of the ClassAct classes installed on your system. "
  116.     (if v39 (cat "OS 3.0 has a standard directory for BOOPSI classes, the SYS:Classes directory. It is recommended that you install ClassAct there.")
  117.             (cat "OS 2.0 does not have a standard place for disk resident BOOPSI classes. On OS 3.0 these classes are stored in the SYS:Classes directory. It is recommended that you create this directory and install ClassAct there.\nThis directory must be added in the LIBS: assign. This can be done by placing the command\nAssign >NIL: LIBS: SYS:Classes ADD\nto User-Startup. This installer will do this for you.")
  118.         )
  119.     )
  120. )
  121. (set #classes-020 "Do you want to use the OS 3.0, 020 optimised version of ClassAct?")
  122. (set #help-020 "Some ClassAct libraries have versions optimised for use on 020 or better equipped OS 3.0 or later machines. If your Amiga is such equipped, you should install these. The 68000/2.0 versions will also work, but are slightly slower.")
  123. (set #noclasses-message "The directory you selected for your ClassAct classes is not a part of the LIBS: assign.\n\nIt is necessary to add this assign so that the classes will be found properly.")
  124. (set #creating-dir "Creating directory ")
  125. (set #usbackup-prompt "User-Startup will now be backed up.")
  126. (set #usbackup-help "This installer will next make a modification in User-Startup. Before doing this the old User-Startup will be backed up to S:User-Startup.old")
  127. (set #adding-1 "Adding ")
  128. (set #adding-2 " to LIBS: assign\n")
  129. (set #adding-help "This is necessary so that the custom classes can be found.")
  130. (set #junod-button "It seems you have a late Commodore 'V42' button.gadget installed on your system.\n\nClassAct's button.gadget is far more capable than this gadget, and we recommend that you replace it. The ClassAct button.gadget is backwards compatible to the Commodore gadget. Do you wish to back up the Commodore gadget and replace it with the ClassAct version?")
  131. (set #junod-backed "The Commodore 'V42' button.gadget has been backed up with the name button.gadget.v42.\n\nThe ClassAct button.gadget will be installed in its place.")
  132. (set #junod-kept "The Commodore 'V42' button.gadget was not replaced with the more capable ClassAct version.\n\nPrograms depending on the availability of ClassAct-only features will be likely to work wrong.")
  133. (set #caprefs-message "ClassAct has several user-configurable aspects that affect the look of ClassAct interfaces.\n\nThese settings can be changed using the ClassAct preferences tool that will be installed in yout Prefs drawer.\n\nA small tool, CAPrefs, will be added to your user-startup to load the settings on reboot.")
  134. (set #caprefs-startup-1 "Adding the command\n\n")
  135. (set #caprefs-startup-2 "\n\nTo your s:User-Startup.")
  136. (set #decompressing-classact "Compressed ClassAct distribution detected\n\nDecompressing to RAM:")
  137. (set #deleting-cltmp "Deleting temporary files")
  138.  
  139. (procedure install-classact
  140. ; call this procedure to copy the classes included in the Classes directory
  141. ; in your distribution dir.
  142.     (if (exists "ClassAct.lha")    ; ClassAct is compressed - need to decompress first
  143.         (                        ; Distribution includes LHEX
  144.             (working (cat #decompressing-classact))
  145. ; ClassAct.lha contains paths/files "Classes/*", "C/CheckAssign", "Prefs/CAPrefs" and "Prefs/ClassAct"
  146.             (run "lhex -aqfw=ram:ClassAct/ x ClassAct.lha")
  147.             (set @classact-source "RAM:ClassAct")
  148.         )
  149.         (set @classact-source (pathonly @icon))
  150.     )
  151.     (if (exists "ClassAct.lzx")    ; ClassAct is compressed - need to decompress first
  152.         (                        ; Distribution includes UNLZX
  153.             (working (cat #decompressing-classact))
  154. ; ClassAct.lzx contains paths/files "Classes/*", "C/CheckAssign",  "Prefs/CAPrefs" and "Prefs/ClassAct"
  155.             (run "unlzx -amq x ClassAct.lzx ram:ClassAct/")
  156.             (set @classact-source "RAM:ClassAct")
  157.         )
  158.         (set @classact-source (pathonly @icon))
  159.     )
  160.  
  161.     (if (exists (tackon @classact-source "Classes")) ; The archive contains a ClassAct library update.
  162.     (
  163.         (set comp-dest  (/ (* classact-complete 2) 10))
  164.         (set comp-libs  (/ (* classact-complete 3) 10))
  165.         (set comp-dirs  (/ (* classact-complete 4) 10))
  166.         (set comp-junod (/ (* classact-complete 5) 10))
  167.         (set comp-020   (/ (* classact-complete 6) 10))
  168.         (set comp-gad   (/ (* classact-complete 7) 10))
  169.         (set comp-im    (/ (* classact-complete 8) 10))
  170.         (set comp-prefs (/ (* classact-complete 9) 10))
  171.     
  172.         ; has the user installed ClassAct in CLASSACT: ?
  173.         (set @classact-dest (getassign "CLASSACT" "A"))
  174.         (if (= @classact-dest "") (set @classact-dest "SYS:Classes"))
  175.         
  176.         ; is ClassAct already in SYS:Classes ?
  177.         (if (or (not (exists (tackon @classact-dest "Gadgets/layout.gadget") (noreq)))
  178.                 (= @user-level 2))
  179.             ; no, ask where it should be placed
  180.             (set @classact-dest
  181.                 (askdir
  182.                     (prompt #classdest-prompt)
  183.                     (help #classdest-help)
  184.                     (default @classact-dest)
  185.                     (newpath)
  186.                 )
  187.             )
  188.         )
  189.         
  190.         (complete comp-dest)
  191.         
  192.         (if (<> (run (cat (tackon @classact-source "C/CheckAssign") " LIBS: " @classact-dest)) 0)
  193.             (
  194.                 (message #noclasses-message)
  195.                 (if (not (exists @classact-dest))
  196.                     (makedir @classact-dest (prompt (cat #creating-dir @classact-dest)))
  197.                 )
  198.                 (set @addassign (cat "Assign >NIL: LIBS: " @classact-dest " ADD\n"))
  199.                 (startup "CLASSACT"
  200.                     (command @addassign)
  201.                     (prompt (cat #adding-1 @classact-dest #adding-2))
  202.                     (help #adding-help)
  203.                 )
  204.                 (run (@addassign))
  205.             )
  206.         )
  207.         
  208.         (complete comp-libs)
  209.         
  210.         (set @classact-gadgets (tackon @classact-dest "Gadgets"))
  211.         (set @classact-images (tackon @classact-dest "Images"))
  212.         
  213.         (if (not (exists @classact-gadgets (noreq)))
  214.             (makedir @classact-images
  215.                 (prompt (cat #creating-dir @classact-gadgets))
  216.             )
  217.         )
  218.         
  219.         (if (not (exists @classact-images (noreq)))
  220.             (makedir @classact-images
  221.                 (prompt (cat #creating-dir @classact-images))
  222.             )
  223.         )
  224.         
  225.         (complete comp-dirs)
  226.         
  227.         (if (exists "SYS:Classes/Gadgets/button.gadget")
  228.             (if (and (= 2752514 (getversion "SYS:Classes/Gadgets/button.gadget"))
  229.                     (= 4868 (getsize "SYS:Classes/Gadgets/button.gadget")))
  230.                 (if (askbool (prompt #junod-button) (help @askbool-help) (default 1))
  231.                     (
  232.                         (rename "SYS:Classes/Gadgets/button.gadget" "SYS:Classes/Gadgets/button.gadget.v42")
  233.                         (message #junod-backed)
  234.                     )
  235.                     (message #junod-kept)
  236.                 )
  237.             )
  238.         )
  239.         
  240.         (complete comp-junod)
  241.         
  242.         (if (and (and cpu020 v39) (exists (tackon @classact-source "Classes/Gadgets/layout.gadget.020")))
  243.             (set classes-020 (askbool (prompt #classes-020) (help #help-020) (default 1)))
  244.             (set classes-020 0)
  245.         )
  246.  
  247.         (complete comp-020)
  248.         
  249.         (set @source-path (tackon @classact-source "Classes/Gadgets"))
  250.         (foreach @source-path "#?.gadget"
  251.             (
  252.                 (set thislib (tackon @source-path @each-name))
  253.                 (if (and classes-020 (exists (cat thislib ".020")))
  254.                     (set thislib (cat thislib ".020"))
  255.                 )
  256.                 (copylib (source thislib)
  257.                     (dest @classact-gadgets)
  258.                     (newname @each-name)
  259.                     (prompt (cat #installing @each-name))
  260.                     (help #classdest-help)
  261.                     (optional "force" "askuser")
  262.                 )
  263.             )
  264.         )
  265.         
  266.         (complete comp-gad)
  267.         
  268.         (set @source-path (tackon @classact-source "Classes/Images"))
  269.         (foreach @source-path "#?.image"
  270.             (
  271.                 (set thislib (tackon @source-path @each-name))
  272.                 (if (and classes-020 (exists (cat thislib ".020")))
  273.                     (set thislib (cat thislib ".020"))
  274.                 )
  275.                 (copylib (source thislib)
  276.                     (dest @classact-images)
  277.                     (newname @each-name)
  278.                     (prompt (cat #installing @each-name))
  279.                     (help #classdest-help)
  280.                     (optional "force" "askuser")
  281.                 )
  282.             )
  283.         )
  284.         
  285.         (complete comp-im)
  286.  
  287.         (set @source-path (tackon @classact-source "Classes"))
  288.         (foreach @source-path "#?.class"
  289.             (
  290.                 (set thislib (tackon @source-path @each-name))
  291.                 (if (and classes-020 (exists (cat thislib ".020")))
  292.                     (set thislib (cat thislib ".020"))
  293.                 )
  294.                 (copylib (source thislib)
  295.                     (dest @classact-dest)
  296.                     (newname @each-name)
  297.                     (prompt (cat #installing @each-name))
  298.                     (help #classdest-help)
  299.                     (optional "force" "askuser")
  300.                 )
  301.             )
  302.         )
  303.     )
  304.     )
  305.     (if (exists (tackon @classact-source "Prefs/ClassAct")) ; The archive contains ClassAct prefs tools
  306.     (
  307.         (message #caprefs-message)
  308.         
  309.         (copylib (source (tackon @classact-source "Prefs/CAPrefs")) 
  310.             (dest "C:") 
  311.             (prompt (cat #installing "CAPrefs"))
  312.         )
  313.         (copylib (source (tackon @classact-source "Prefs/ClassAct"))
  314.             (dest "SYS:Prefs")
  315.             (prompt (cat #installing "ClassAct Prefs"))
  316.             (infos)
  317.         )
  318.         
  319.         (complete comp-prefs)
  320.         
  321.         (if (not (exists "ENVARC:ClassAct" (noreq)))
  322.             (
  323.                 (makedir "ENVARC:ClassAct"
  324.                     (prompt (cat #creating-dir "ENVARC:ClassAct"))
  325.                 )
  326.                 (textfile (dest "ENVARC:ClassAct/ClassAct")
  327.                     (append "")
  328.                 )
  329.             )
  330.         )
  331.         (set caprefs-cmd "C:CAPrefs >NIL:\n")
  332.  
  333.         (startup "CAPREFS"
  334.             (prompt (cat #caprefs-startup-1 caprefs-cmd #caprefs-startup-2))
  335.             (help #caprefs-message)
  336.             (command caprefs-cmd)
  337.         )
  338.     )
  339.     )
  340.     
  341.     (if (exists "ClassAct.lha")
  342.         (delete "RAM:ClassAct" (all)
  343.             (prompt #deleting-cltmp)
  344.         )
  345.     )
  346.  
  347.     (complete classact-complete)
  348. )
  349.  
  350. ; ************** END OF CLASSACT INSTALL PROCEDURE. COPY THE BLOCK ABOVE
  351. ; ************** TO YOUR CLASSACT APPLICATION INSTALLER.
  352.  
  353. ; ---------------------------------------------------------------------------
  354. (procedure set_dl_dir
  355.     (set DL_Dir (expandpath DL_Dir))
  356.     
  357.     ; verify that the download directory exists
  358.     (if (<> (exists DL_Dir) is_a_dir)
  359.         (
  360.             (makedir DL_Dir
  361.                 (prompt
  362.                     "The directory you have selected for download "
  363.                     "directory does not seem to exist.\n\n"
  364.                     "Do you want it to be created for you?")
  365.                 (help @makedir-help)
  366.                 (infos)
  367.                 (confirm)
  368.             )
  369.         )
  370.     )
  371.     (if (<> DL_Dir "")
  372.         (if (= (exists DL_Dir) is_a_dir)
  373.             (
  374.                 (set dlstr (cat dlstr "sys:rexxc/rx THOR:rexx/bbsread/cfgglobal.br DNL " quote DL_Dir quote))
  375.                 (run dlstr)
  376.                 (run dlstr)
  377.             )
  378.         )
  379.     )
  380.     (if (patmatch '#? #?' DL_Dir)
  381.         (set dldirproblem 1)
  382.     )
  383. )
  384.  
  385. (procedure set_ul_dir
  386.     (set UL_Dir (expandpath UL_Dir))
  387.     
  388.     ; verify that the upload directory exists
  389.     (if (<> (exists UL_Dir) is_a_dir)
  390.         (
  391.             (makedir UL_Dir
  392.                 (prompt
  393.                     "The directory you have selected for upload of "
  394.                     "reply packets does not seem to exist.\n\n"
  395.                     "Do you want it to be created for you?")
  396.                 (help @makedir-help)
  397.                 (infos)
  398.                 (confirm)
  399.             )
  400.         )
  401.     )
  402.     (if (<> UL_Dir "")
  403.         (if (= (exists UL_Dir) is_a_dir)
  404.             (
  405.                 (set ulstr (cat ulstr "sys:rexxc/rx THOR:rexx/bbsread/cfgglobal.br UPL " quote UL_Dir quote))
  406.                 (run ulstr)
  407.             )
  408.         )
  409.     )
  410. )
  411.  
  412. (procedure create_inet_system
  413.     (set systemname
  414.         (askstring
  415.             (prompt 
  416.                     "Please enter the name of the Internet system. "
  417.                     "This is the name used internally in THOR. ")
  418.             (help "This information is needed to configure a new system "
  419.                     "for use in THOR. ")
  420.             (default "Internet")
  421.         )
  422.     )
  423.     (set UserName
  424.         (if (exists 'ENV:USERNAME' (noreq))
  425.             (getenv 'USERNAME')
  426.             (if (exists 'ENV:USER' (noreq))
  427.                 (getenv 'USER')
  428.                 'username'
  429.             )
  430.         )
  431.     )
  432.     (set UserName
  433.         (askstring
  434.             (prompt "If you get mail using SMTPd or a similar program, "
  435.                     "please enter your user name now (which is also "
  436.                     "the name of the mailfile). If you want to use "
  437.                     "THOR's POP client for collecting mail, you can "
  438.                     "leave this blank.")
  439.             (help "This information is only needed if you get mail "
  440.                     "by some other means than the method THOR supports "
  441.                     "(eg. using SMTPd).")
  442.             (default UserName)
  443.         )
  444.     )
  445.     (if (= UserName "")
  446.         ( ; Then
  447.             (set sysstr (cat sysstr "sys:rexxc/rx THOR:rexx/bbsread/cfgbbs.br BBSNAME " quote systemname quote " TYPE TCP"))
  448.         )
  449.         ( ; Else
  450.             (set sysstr (cat sysstr "sys:rexxc/rx THOR:rexx/bbsread/cfgbbs.br BBSNAME " quote systemname quote " GRAB " quote UserName quote " TYPE TCP"))
  451.         )
  452.     )
  453.     (run sysstr)
  454. )
  455.  
  456. (procedure WAITX (set X 1) ( (while (< X 100)  (set X (+ X 1)) )  ) )
  457.  
  458. (working "\n\n\n\n\n\n\n\n\n\n\n\n\nTHOR 2.4") (WAITX)
  459. (working "\n\n\n\n\n\n\n\n\n\n\n\nTHOR 2.4") (WAITX)
  460. (working "\n\n\n\n\n\n\n\n\n\n\nTHOR 2.4") (WAITX)
  461. (working "\n\n\n\n\n\n\n\n\n\nTHOR 2.4") (WAITX)
  462. (working "\n\n\n\n\n\n\n\n\nTHOR 2.4") (WAITX)
  463. (working "\n\n\n\n\n\n\n\nTHOR 2.4") (WAITX)
  464. (working "\n\n\n\n\n\n\nTHOR 2.4") (WAITX)
  465. (working "\n\n\n\n\n\nTHOR 2.4") (WAITX)
  466. (working "\n\n\n\n\nTHOR 2.4") (WAITX)
  467. (working "\n\n\n\nTHOR 2.4") (WAITX)
  468. (working "\n\n\nTHOR 2.4") (WAITX)
  469. (working "\n\nTHOR 2.4") (WAITX)
  470. (working "\n\nTHOR 2.4") (WAITX)
  471. (working "\nTHOR 2.4") (WAITX)
  472. (working "\nTHOR 2.4") (WAITX)
  473.  
  474. (working "\nTHOR 2.4\n\n\n\n\n\n\n\n\n\n\n\nby") (WAITX)
  475. (working "\nTHOR 2.4\n\n\n\n\n\n\n\n\n\n\nby") (WAITX)
  476. (working "\nTHOR 2.4\n\n\n\n\n\n\n\n\n\nby") (WAITX)
  477. (working "\nTHOR 2.4\n\n\n\n\n\n\n\n\nby") (WAITX)
  478. (working "\nTHOR 2.4\n\n\n\n\n\n\n\nby") (WAITX)
  479. (working "\nTHOR 2.4\n\n\n\n\n\n\nby") (WAITX)
  480. (working "\nTHOR 2.4\n\n\n\n\n\nby") (WAITX)
  481. (working "\nTHOR 2.4\n\n\n\n\nby") (WAITX)
  482. (working "\nTHOR 2.4\n\n\n\nby") (WAITX)
  483. (working "\nTHOR 2.4\n\n\nby") (WAITX)
  484. (working "\nTHOR 2.4\n\n\nby") (WAITX)
  485.  
  486. (working "\nTHOR 2.4\n\n\nby\n\n\n\n\n\n\n\n\nUltima Thule Software") (WAITX) 
  487. (working "\nTHOR 2.4\n\n\nby\n\n\n\n\n\n\n\nUltima Thule Software") (WAITX) 
  488. (working "\nTHOR 2.4\n\n\nby\n\n\n\n\n\n\nUltima Thule Software") (WAITX) 
  489. (working "\nTHOR 2.4\n\n\nby\n\n\n\n\n\nUltima Thule Software") (WAITX) 
  490. (working "\nTHOR 2.4\n\n\nby\n\n\n\n\nUltima Thule Software") (WAITX) 
  491. (working "\nTHOR 2.4\n\n\nby\n\n\n\nUltima Thule Software") (WAITX) 
  492. (working "\nTHOR 2.4\n\n\nby\n\n\nUltima Thule Software") (WAITX) 
  493.  
  494. (message "\n\n\nTHOR 2.4\n\n\nby\n\n\nUltima Thule Software") (WAITX) 
  495.  
  496. (welcome)
  497.  
  498. ; first reset the user level so that the novice can see what's going on
  499.     (save_default_level)
  500.     (expert_level)
  501.  
  502. ;Make assign to install from
  503.     (makeassign "Thor_Install" "" (safe))
  504.  
  505.  
  506. ;******************
  507. ;** Check Memory **
  508. ;******************
  509.  
  510. (run "Avail flush")
  511.  
  512. (set Running (run "Thor_Install:CheckForLib"))
  513.  
  514. (while (= Running 20)
  515.       (
  516.         (Message newline "Thor seem to be running, you MUST close it NOW."    
  517.                 newline "If you don't, the installation will fail!")
  518.         (run "Avail flush")
  519.         (set Running (run "Thor_Install:CheckForLib"))
  520.     )
  521. )
  522.  
  523. ;************************
  524. ;** Start Installation **
  525. ;************************
  526.  
  527. (if (exists "Thor:libs/bbsread.library" (noreq))
  528.     ( ; Then
  529.         (set end_text "Please use the UpdateThor script to\nupdate your already installed THOR.")
  530.         (abort end_text)
  531.     )
  532. )
  533.  
  534. (if (exists "BBSData:global.config" (noreq))
  535. ; Then
  536.     ((set end_text "Please use the UpdateThor script to\nupdate your already installed THOR.")
  537.     (abort end_text))
  538. )
  539.  
  540. (if (exists "envarc:THOR/BBSDataPath" (noreq))
  541.     (
  542.         (if    (askbool
  543.                    (prompt 
  544.                         "THOR seems to be already installed, "
  545.                         "do you want to install it again from scratch?")
  546.                 (help 
  547.                         "The installer script has found a previous "
  548.                         "installation of THOR.\n\n"
  549.                         "Select YES if you want it install again, otherwise NO")
  550.                 (default 1)
  551.             )
  552.             ; Then
  553.             (
  554.                 (delete "envarc:thor" (all))
  555.                 (delete "env:thor" (all))
  556.                 (run "delete env:thor all force")
  557.                 (run "delete envarc:thor all force")
  558.             )
  559.             ; Else
  560.             (
  561.                 (set end_text "Please use the UpdateThor script to\nupdate your already installed THOR.")
  562.                 (abort end_text)
  563.             )
  564.         )
  565.     )
  566. )
  567.  
  568. (set Thor_Dir 
  569.     (askdir
  570.         (prompt "Where would you like Thor installed?"
  571.         newline "The installer will NOT create a directory!")
  572.         (help @askdir-help)
  573.         (default "Work:")
  574.         (newpath)
  575.     )
  576. )
  577. (set Thor_Dir (expandpath Thor_Dir))
  578.  
  579. ; before we go on lets reset the user's level back to what it was
  580. (default_level)
  581.  
  582. ; verify that the Thor directory exists
  583. (if (<> (exists Thor_Dir) is_a_dir)
  584.     (
  585.         (makedir Thor_Dir
  586.             (prompt
  587.                 "The directory you have selected for Thor does not "
  588.                 "seem to exist.  Do you want us to create it for you?"
  589.             )
  590.             (help @makedir-help)
  591.             (infos)
  592.             (confirm)
  593.         )
  594.     )
  595. )
  596.  
  597. ; Create directories for the THOR installation
  598.  
  599. (makeassign "Thor" Thor_dir)
  600. (makedir "Thor:Data")
  601. (makeassign "BBSData" "Thor:data")
  602.  
  603. ;***********************************
  604. ;***** GET FIRST DISK IN HERE ******
  605. ;***********************************
  606.  
  607. ; first copy over the stuff
  608. (working #omp "Decompressing and copying Thor files.")
  609.  
  610. (run "Thor_Install:lha -a x Thor_Install:thor.lha THOR:" )
  611.  
  612. ;************************
  613. ;**  Copy the keyfile  **
  614. ;************************
  615. (if (exists "Thor_Install:THOR.key" (noreq))
  616. ; Then
  617.     (copyfiles
  618.         (source "Thor_Install:THOR.key")
  619.         (dest "THOR:")
  620.         (nogauge)
  621.     )
  622. )
  623.         
  624. ;*****************************************
  625. ;**  Copy the default arexx macro file  **
  626. ;*****************************************
  627. (if (exists "Thor_Install:THOR.macros" (noreq))
  628. ; Then
  629.     (copyfiles
  630.         (source "Thor_Install:THOR.macros")
  631.         (dest "THOR:")
  632.         (nogauge)
  633.     )
  634. )
  635.  
  636. (default_level)
  637.         
  638. ;***********************************
  639. ; Create the environment variables *
  640. ;***********************************
  641.  
  642. (set Running (run "Thor:bin/basemanager convert"))
  643. (if (<> 0 Running)
  644.     (
  645.         ((set end_text "Basemanager failed in setting up the env-variables.")
  646.         (abort end_text))
  647.     )
  648. )
  649.  
  650. ;******************
  651. ;** Locale stuff **
  652. ;******************
  653.  
  654. (default_level)
  655.  
  656. (set catalog
  657.    (askoptions
  658.       (prompt "What languages would you like to install ?\n"
  659.             "English is the built-in language.")
  660.       (help
  661.             "This will install locale files for other languages than English. "
  662.             "You can set the prefered language on Workbench and in Thor by"
  663.             "using the Sys:Prefs/Locale tool." newline @askchoice-help
  664.       )
  665.       (choices "Norsk" "Dansk" "Svenska" "Deutsch" "Français" "Italiano" "Nederlands")
  666.       (default 0)
  667.    )
  668. )
  669.  
  670. (makedir "thor:catalogs")
  671.  
  672. (if (bitand 1 catalog)
  673.     (copyfiles
  674.         (source "Thor_Install:catalogs/norsk")
  675.         (dest "thor:catalogs/norsk")
  676.         (all)
  677.     )
  678. )
  679.  
  680. (if (bitand 2 catalog)
  681.     (copyfiles
  682.         (source "Thor_Install:catalogs/dansk")
  683.         (dest "thor:catalogs/dansk")
  684.         (all)
  685.     )
  686. )
  687.  
  688. (if (bitand 4 catalog)
  689.     (copyfiles
  690.         (source "Thor_Install:catalogs/svenska")
  691.         (dest "thor:catalogs/svenska")
  692.         (all)
  693.     )
  694. )
  695.  
  696. (if (bitand 8 catalog)
  697.     (copyfiles
  698.         (source "Thor_Install:catalogs/deutsch")
  699.         (dest "thor:catalogs/deutsch")
  700.         (all)
  701.     )
  702. )
  703.  
  704. (if (bitand 16 catalog)
  705.     (copyfiles
  706.         (source "Thor_Install:catalogs/français")
  707.         (dest "thor:catalogs/français")
  708.         (all)
  709.     )
  710. )
  711.  
  712. (if (bitand 32 catalog)
  713.     (copyfiles
  714.         (source "Thor_Install:catalogs/italiano")
  715.         (dest "thor:catalogs/italiano")
  716.         (all)
  717.     )
  718. )
  719.  
  720. (if (bitand 64 catalog)
  721.     (copyfiles
  722.         (source "Thor_Install:catalogs/nederlands")
  723.         (dest "thor:catalogs/nederlands")
  724.         (all)
  725.     )
  726. )
  727.  
  728. ;*********************
  729. ;** reqtools.libary **
  730. ;*********************
  731.  
  732. (copylib
  733.     (prompt "Copying ReqTools library")
  734.     (help "This will copy the ReqTools library." newline @copylib-help)
  735.     (source "Thor_Install:reqtools.library")
  736.     (dest "libs:")
  737.     (confirm)
  738. )
  739.  
  740. ;***********
  741. ;** Fonts **
  742. ;***********
  743.     
  744. (copyfiles
  745.     (prompt "Choose the fonts to install with Thor" newline "These are not required for Thor to run" )
  746.     (help "This will copy the default font files for Thor." newline @copyfiles-help)
  747.     (source "Thor_Install:Fonts")
  748.     (dest "Fonts:")
  749.     (fonts)
  750.     (choices "Grn" "Thin609" "Thin611" "Thin711")
  751. )
  752.  
  753. ;**************************************
  754. ;* Install the bbsread database stuff *
  755. ;**************************************
  756.  
  757. (set failed (run "thor:bin/initarc"))
  758. (if (<> 0 failed)
  759.     (
  760.         ((set end_text "Installation failed.\nIf you received any error message,\nplease write this down and send us\na mail about the problem.")
  761.         (abort end_text))
  762.     )
  763. )
  764.  
  765. (run "thor:bin/InitCharsets")
  766.  
  767. (expert_level)
  768.  
  769. (set defpath (pathonly @icon))
  770.  
  771. (if    (askbool
  772.         (prompt newline 
  773.                         "Would you like to install the optional ARexx "
  774.                         "scripts for THOR? "
  775.         (help newline
  776.                         "This section of the installation is dedicated "
  777.                         "to installation of some optional ARexx scripts.\n\n "
  778.                         "Select YES if you want to continue with this "
  779.                         "installation, otherwise NO"))
  780.         (default 1)
  781.     )
  782.     ; Then 
  783.     (
  784.         (set isthere 20)
  785.         (while (= 20 isthere)
  786.             (set arexxfile 
  787.                 (askfile
  788.                     (prompt (cat  
  789.                             "Please select the ARexx archive for THOR 2.4\n"
  790.                             "(Usually named '"#arexxpackname"').\n\n"
  791.                             "It will be unarchived automatically."))
  792.                     (help @askfile-help)
  793.                     (default (tackon defpath #arexxpackname))
  794.                 )
  795.             )
  796.             ; verify that the file exists
  797.             (if (exists arexxfile)
  798.                 (
  799.                     (set isthere 0)
  800.                     (set defpath (pathonly arexxfile))
  801.                     (set runfile3 (cat runfile3 "Thor_Install:lha -a x " quote arexxfile quote " Thor:rexx/"))
  802.                     (set failed (run runfile3))
  803.                     (if (<> 0 failed)
  804.                         (
  805.                             ((set failed_text "Unarchiving of the ARexx archive failed.")
  806.                                 (message end_text))
  807.                         )
  808.                     )
  809.                 )
  810.                 ; else
  811.                 (
  812.                     (if    (askbool
  813.                                (prompt 
  814.                                 "File doesn't exist.\n\nDo you want to try again?"
  815.                                 (default 1)
  816.                                 (help "YES to select the correct file, or NO to continue without installing this archive.")
  817.                             )
  818.                         )
  819.                         ; Then
  820.                         (
  821.                             (set isthere 20)
  822.                         )
  823.                         ; Else
  824.                         (
  825.                             (set isthere 0)
  826.                         )
  827.                     )
  828.                 )
  829.             )
  830.         )
  831.     )
  832. )
  833.  
  834. (if (exists "Thor_Install:bin/parseqwk" (noreq))
  835.     ; Then
  836.     (
  837.         (set bbspack 1)
  838.     )
  839.     ; Else
  840.     (
  841.         (if    (askbool
  842.                 (prompt newline 
  843.                                 "Would you like to install the modules for "
  844.                                 "QWK, Fido, Hippo, Bluewave, ABBS/MBBS and Omen "
  845.                                 "to be used with Bulletin Board Systems?\n\n "
  846.                                 "(you will be able to select which modules to "
  847.                                 "install later in this installation procedure).")
  848.                 (help newline
  849.                                 "This section of the installation is dedicated "
  850.                                 "to installation of some common formats "
  851.                                 "required if you want to use THOR with BBSes.\n\n"
  852.                                 "Select YES if you want to continue with this "
  853.                                 "installation, otherwise NO")
  854.                 (default 1)
  855.             )
  856.             ; Then 
  857.             (
  858.                 (set isthere 20)
  859.                 (while (= 20 isthere)
  860.                     (set bbsfile 
  861.                         (askfile
  862.                             (prompt (cat "Please select the BBS archive for THOR 2.4. "
  863.                                     "(Usually named '"#bbspackname"').\n\n"
  864.                                     "It will be unarchived automatically."))
  865.                             (help @askfile-help)
  866.                             (default (tackon defpath #bbspackname))
  867.                         )
  868.                     )
  869.                     ; verify that the file exists
  870.                     (if (exists bbsfile)
  871.                         (
  872.                             (set isthere 0)
  873.                             (set defpath (pathonly bbsfile))
  874.                             (set runfile (cat runfile "Thor_Install:lha -a x " quote bbsfile quote " Thor_Install:"))
  875.                             (set failed (run runfile))
  876.                             (if (<> 0 failed)
  877.                                 (
  878.                                     ((set failed_text "Unarchiving of the BBS archive failed.")
  879.                                         (message end_text))
  880.                                 )
  881.                                 ; Else
  882.                                 (
  883.                                     (set bbspack 1)
  884.                                 )
  885.                             )
  886.                         )
  887.                         ; else
  888.                         (
  889.                             (if    (askbool
  890.                                           (prompt 
  891.                                         "File doesn't exist.\n\nDo you want to try again?"
  892.                                         (default 1)
  893.                                         (help "YES to select the correct file, or NO to continue without installing this archive.")
  894.                                     )
  895.                                 )
  896.                                 ; Then
  897.                                 (
  898.                                     (set isthere 20)
  899.                                 )
  900.                                 ; Else
  901.                                 (
  902.                                     (set isthere 0)
  903.                                 )
  904.                             )
  905.                         )
  906.                     )
  907.                 )
  908.             )
  909.         )
  910.     )
  911. )
  912.  
  913. (if (exists "Thor_Install:bin/gettcp" (noreq))
  914.     ; Then
  915.     (
  916.         (set inetpack 1)
  917.     )
  918.     ; Else
  919.     (
  920.         (if    (askbool
  921.                 (prompt newline 
  922.                                 "Would you like to install the modules for "
  923.                                 "UUCP, SOUP, NNTP, SMTP and POP3 "
  924.                                 "to be used with Internet?\n\n"
  925.                                 "(you will be able to select which modules to "
  926.                                 "install later in this installation procedure).")
  927.                 (help newline
  928.                                 "This section of the installation is dedicated "
  929.                                 "to installation of some common formats "
  930.                                 "required if you want to use THOR with Internet.\n\n"
  931.                                 "Select YES if you want to continue with this "
  932.                                 "installation, otherwise NO")
  933.                 (default 1)
  934.             )
  935.             ; Then 
  936.             (
  937.                 (set isthere 20)
  938.                 (while (= 20 isthere)
  939.                     (set inetfile 
  940.                         (askfile
  941.                             (prompt (cat  
  942.                                     "Please select the Internet archive for THOR 2.4\n"
  943.                                     "(Usually named '"#inetpackname"').\n\n"
  944.                                     "It will be unarchived automatically."))
  945.                             (help @askfile-help)
  946.                             (default (tackon defpath #inetpackname))
  947.                         )
  948.                     )
  949.                     ; verify that the file exists
  950.                     (if (exists inetfile)
  951.                         (
  952.                             (set isthere 0)
  953.                             (set runfile2 (cat runfile2 "Thor_Install:lha -a x " quote inetfile quote " Thor_Install:"))
  954.                             (set failed (run runfile2))
  955.                             (if (<> 0 failed)
  956.                                 (
  957.                                     ((set failed_text "Unarchiving of the Internet archive failed.")
  958.                                         (message end_text))
  959.                                 )
  960.                                 ; Else
  961.                                 (
  962.                                     (set inetpack 1)
  963.                                 )
  964.                             )
  965.                         )
  966.                         ; else
  967.                         (
  968.                             (if    (askbool
  969.                                           (prompt 
  970.                                         "File doesn't exist.\n\nDo you want to try again?"
  971.                                         (default 1)
  972.                                         (help "YES to select the correct file, or NO to continue without installing this archive.")
  973.                                     )
  974.                                 )
  975.                                 ; Then
  976.                                 (
  977.                                     (set isthere 20)
  978.                                 )
  979.                                 ; Else
  980.                                 (
  981.                                     (set isthere 0)
  982.                                 )
  983.                             )
  984.                         )
  985.                     )
  986.                 )
  987.             )
  988.         )
  989.     )
  990. )
  991.  
  992. (if (= bbspack 1)
  993.     (
  994.         (set bbs_type
  995.            (askoptions
  996.               (prompt
  997.                         "Please select which BBS modules "
  998.                         "you want to install.")
  999.               (help
  1000.                     "What system type for BBS usage that should be "
  1001.                     "installed can be selected here."
  1002.               )
  1003.  
  1004.               (choices
  1005.                     "QWK        - Normal QWK"
  1006.                     "Fido       - Normal Fidonet"
  1007.                     "BlueWave   - Normal BlueWave"
  1008.                     "ABBS       - Normal ABBS"
  1009.                     "ABBS_QWK   - ABBS with QWK support"
  1010.                     "MBBS       - Normal MBBS"
  1011.                     "Hippo/BBBS - Normal Hippo V2 and Hippo on BBBS"
  1012.                     "Omen       - Normal Omen"
  1013.               )
  1014.               (default -1)
  1015.            )
  1016.         )
  1017.         (copyfiles
  1018.             (source "Thor_Install:scripts")
  1019.             (dest "THOR:scripts")
  1020.             (pattern "#?BBS#?")
  1021.         )
  1022.         (if (bitand 1 bbs_type)
  1023.             (
  1024.                 (copyfiles
  1025.                     (source "Thor_Install:bin")
  1026.                     (dest "THOR:bin")
  1027.                     (pattern "#?QWK")
  1028.                 )
  1029.                 (copyfiles
  1030.                     (source "Thor_Install:s/cfgqwk")
  1031.                     (dest "THOR:s")
  1032.                 )
  1033.                 (execute "thor:s/cfgqwk")
  1034.             )
  1035.         )
  1036.         (if (bitand 2 bbs_type)
  1037.             (
  1038.                 (copyfiles
  1039.                     (source "Thor_Install:bin")
  1040.                     (dest "THOR:bin")
  1041.                     (pattern "#?FIDO")
  1042.                 )
  1043.                 (copyfiles
  1044.                     (source "Thor_Install:s")
  1045.                     (dest "THOR:s")
  1046.                     (pattern "cfgfido#?")
  1047.                 )
  1048.                 (execute "thor:s/cfgfido")
  1049.                 (execute "thor:s/cfgfido_export")
  1050.             )
  1051.         )
  1052.         (if (bitand 4 bbs_type)
  1053.             (
  1054.                 (copyfiles
  1055.                     (source "Thor_Install:bin")
  1056.                     (dest "THOR:bin")
  1057.                     (pattern "#?BLUE")
  1058.                 )
  1059.                 (copyfiles
  1060.                     (source "Thor_Install:s/cfgblue")
  1061.                     (dest "THOR:s")
  1062.                 )
  1063.                 (execute "thor:s/cfgblue")
  1064.             )
  1065.         )
  1066.         (if (bitand 8 bbs_type)
  1067.             (
  1068.                 (copyfiles
  1069.                     (source "Thor_Install:bin/packambbs")
  1070.                     (dest "THOR:bin")
  1071.                 )
  1072.                 (copyfiles
  1073.                     (source "Thor_Install:bin/parsemsg")
  1074.                     (dest "THOR:bin")
  1075.                 )
  1076.                 (copyfiles
  1077.                     (source "Thor_Install:s/cfgabbs")
  1078.                     (dest "THOR:s")
  1079.                 )
  1080.                 (execute "thor:s/cfgabbs")
  1081.             )
  1082.         )
  1083.         (if (bitand 16 bbs_type)
  1084.             (
  1085.                 (copyfiles
  1086.                     (source "Thor_Install:bin")
  1087.                     (dest "THOR:bin")
  1088.                     (pattern "#?QWK")
  1089.                 )
  1090.                 (copyfiles
  1091.                     (source "Thor_Install:s/cfgabbs_qwk")
  1092.                     (dest "THOR:s")
  1093.                 )
  1094.                 (execute "thor:s/cfgabbs_qwk")
  1095.             )
  1096.         )
  1097.         (if (bitand 32 bbs_type)
  1098.             (
  1099.                 (copyfiles
  1100.                     (source "Thor_Install:bin/packambbs")
  1101.                     (dest "THOR:bin")
  1102.                 )
  1103.                 (copyfiles
  1104.                     (source "Thor_Install:bin/parsemsg")
  1105.                     (dest "THOR:bin")
  1106.                 )
  1107.                 (copyfiles
  1108.                     (source "Thor_Install:s/cfgmbbs")
  1109.                     (dest "THOR:s")
  1110.                 )
  1111.                 (execute "thor:s/cfgmbbs")
  1112.             )
  1113.         )
  1114.         (if (bitand 64 bbs_type)
  1115.             (
  1116.                 (copyfiles
  1117.                     (source "Thor_Install:bin")
  1118.                     (dest "THOR:bin")
  1119.                     (pattern "#?hippo")
  1120.                 )
  1121.                 (copyfiles
  1122.                     (source "Thor_Install:s/cfghippo")
  1123.                     (dest "THOR:s")
  1124.                 )
  1125.                 (copyfiles
  1126.                     (source "Thor_Install:s/cfgbbbs")
  1127.                     (dest "THOR:s")
  1128.                 )
  1129.                 (execute "thor:s/cfghippo")
  1130.                 (execute "thor:s/cfgbbbs")
  1131.             )
  1132.         )
  1133.         (if (bitand 128 bbs_type)
  1134.             (
  1135.                 (copyfiles
  1136.                     (source "Thor_Install:bin")
  1137.                     (dest "THOR:bin")
  1138.                     (pattern "#?omen")
  1139.                 )
  1140.                 (copyfiles
  1141.                     (source "Thor_Install:s/cfgomen")
  1142.                     (dest "THOR:s")
  1143.                 )
  1144.                 (execute "thor:s/cfgomen")
  1145.             )
  1146.         )
  1147.     )
  1148. )
  1149.  
  1150. (if (= inetpack 1)
  1151.     (
  1152.         (set bbs_type
  1153.            (askoptions
  1154.               (prompt
  1155.                         "Please select which Internet modules "
  1156.                         "you want to install.")
  1157.               (help
  1158.                     "What system type for Internet usage that should be "
  1159.                     "installed can be selected here."
  1160.               )
  1161.  
  1162.               (choices
  1163.                         "TCP/TCP_ONLINE - POP3, SMTP and NNTP"
  1164.                         "SOUP/UQWK_SOUP - Normal SOUP and SOUP w/uqwk"
  1165.                         "UUCP           - Normal UUCP"
  1166.               )
  1167.               (default -1)
  1168.            )
  1169.         )
  1170.  
  1171.         (copyfiles
  1172.             (source "Thor_Install:libs/utnet.library")
  1173.             (dest "THOR:libs")
  1174.         )
  1175.  
  1176.         (copyfiles
  1177.             (source "Thor_Install:bin/InitRFC")
  1178.             (dest "THOR:bin")
  1179.         )
  1180.  
  1181.         (copyfiles
  1182.             (source "Thor_Install:scripts")
  1183.             (dest "THOR:scripts")
  1184.             (pattern "#?UQWK#?")
  1185.         )
  1186.  
  1187.         (if (bitand 1 bbs_type)
  1188.             (
  1189.                 (copyfiles
  1190.                     (source "Thor_Install:bin")
  1191.                     (dest "THOR:bin")
  1192.                     (pattern "#?(UUCP|TCP)")
  1193.                 )
  1194.                 (copyfiles
  1195.                     (source "Thor_Install:")
  1196.                     (dest "THOR:")
  1197.                     (pattern "ConnectTHOR#?")
  1198.                 )
  1199.                 (copyfiles
  1200.                     (source "Thor_Install:s/cfgtcp")
  1201.                     (dest "THOR:s")
  1202.                 )
  1203.                 (copyfiles
  1204.                     (source "Thor_Install:s/cfgtcp_online")
  1205.                     (dest "THOR:s")
  1206.                 )
  1207.                 (execute "thor:s/cfgtcp")
  1208.                 (execute "thor:s/cfgtcp_online")
  1209.                 (set classact 1)
  1210.                 (set tcptype 1)
  1211.             )
  1212.         )
  1213.         (if (bitand 2 bbs_type)
  1214.             (
  1215.                 (copyfiles
  1216.                     (source "Thor_Install:bin")
  1217.                     (dest "THOR:bin")
  1218.                     (pattern "#?SOUP")
  1219.                 )
  1220.                 (copyfiles
  1221.                     (source "Thor_Install:s")
  1222.                     (dest "THOR:s")
  1223.                     (pattern "#?soup")
  1224.                 )
  1225.                 (makedir "THOR:unix")
  1226.                 (copyfiles
  1227.                     (source "Thor_Install:unix")
  1228.                     (dest "THOR:unix")
  1229.                     (all)
  1230.                 )
  1231.                 (execute "thor:s/cfguqwk_soup")
  1232.                 (execute "thor:s/cfgsoup")
  1233.             )
  1234.         )
  1235.         (if (bitand 4 bbs_type)
  1236.             (
  1237.                 (copyfiles
  1238.                     (source "Thor_Install:bin")
  1239.                     (dest "THOR:bin")
  1240.                     (pattern "#?UUCP")
  1241.                 )
  1242.                 (copyfiles
  1243.                     (source "Thor_Install:s/cfguucp")
  1244.                     (dest "THOR:s")
  1245.                 )
  1246.                 (execute "thor:s/cfguucp")
  1247.                 (set uucptype 1)
  1248.             )
  1249.         )
  1250.     )
  1251. )
  1252.  
  1253. (if (= classact 1)
  1254.     (
  1255.         (install-classact)
  1256.     )
  1257. )
  1258.  
  1259. ;*****************************
  1260. ;****** Install icons ********
  1261. ;*****************************
  1262.  
  1263. (set icon
  1264.     (askchoice
  1265.         (prompt
  1266.             "Please select what icon-set to install with THOR.\n")
  1267.         (help
  1268.             "If you use MagicWB on your Workbench, "
  1269.             "you might want to install the special MagicWB icons.\n\n"
  1270.             "Likewise, if you use NewIcons on your Workbench, "
  1271.             "you might want to install the special NewIcons icons.")
  1272.         (choices "Normal icons" "MagicWB icons" "NewIcons icons")
  1273.         (default 0)
  1274.     )
  1275. )
  1276.  
  1277. (if (= icon 1)
  1278.     (
  1279.         (copyfiles
  1280.             (prompt "Copying MagicWB icon files")
  1281.             (source "Thor_Install:MWBIcons")
  1282.             (dest "Thor:")
  1283.             (pattern "~(THOR.guide.info)")
  1284.             (noposition)
  1285.             (nogauge)
  1286.         )
  1287.         (copyfiles
  1288.             (prompt "Copying MagicWB icon files")
  1289.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  1290.             (dest "Thor:Docs")
  1291.             (newname "THOR.guide.info")
  1292.             (noposition)
  1293.             (nogauge)
  1294.         )
  1295.         (copyfiles
  1296.             (prompt "Copying MagicWB icon files")
  1297.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  1298.             (dest "Thor:Docs")
  1299.             (newname "ConfigTHOR.guide.info")
  1300.             (noposition)
  1301.             (nogauge)
  1302.         )
  1303.         (copyfiles
  1304.             (prompt "Copying MagicWB icon files")
  1305.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  1306.             (dest "Thor:Docs")
  1307.             (newname "ARexx.guide.info")
  1308.             (noposition)
  1309.             (nogauge)
  1310.         )
  1311.         (copyfiles
  1312.             (prompt "Copying MagicWB icon files")
  1313.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  1314.             (dest "Thor:Docs")
  1315.             (newname "BBSReadRexx.guide.info")
  1316.             (noposition)
  1317.             (nogauge)
  1318.         )
  1319.         (copyfiles
  1320.             (prompt "Copying MagicWB icon files")
  1321.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  1322.             (dest "Thor:Docs")
  1323.             (newname "THOR_Rexx.guide.info")
  1324.             (noposition)
  1325.             (nogauge)
  1326.         )
  1327.         (copyfiles
  1328.             (prompt "Copying MagicWB icon files")
  1329.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  1330.             (dest "Thor:Docs")
  1331.             (newname "Installation.guide.info")
  1332.             (noposition)
  1333.             (nogauge)
  1334.         )
  1335.     )
  1336. )
  1337. (if (= icon 2)
  1338.     (
  1339.         (copyfiles
  1340.             (prompt "Copying NewIcons icon files")
  1341.             (source "Thor_Install:NewIcons")
  1342.             (dest "Thor:")
  1343.             (pattern "~(THOR.guide.info)")
  1344.             (noposition)
  1345.             (nogauge)
  1346.         )
  1347.         (copyfiles
  1348.             (prompt "Copying NewIcons icon files")
  1349.             (source "Thor_Install:NewIcons/THOR.guide.info")
  1350.             (dest "Thor:Docs")
  1351.             (newname "THOR.guide.info")
  1352.             (noposition)
  1353.             (nogauge)
  1354.         )
  1355.         (copyfiles
  1356.             (prompt "Copying NewIcons icon files")
  1357.             (source "Thor_Install:NewIcons/THOR.guide.info")
  1358.             (dest "Thor:Docs")
  1359.             (newname "ConfigTHOR.guide.info")
  1360.             (noposition)
  1361.             (nogauge)
  1362.         )
  1363.         (copyfiles
  1364.             (prompt "Copying NewIcons icon files")
  1365.             (source "Thor_Install:NewIcons/THOR.guide.info")
  1366.             (dest "Thor:Docs")
  1367.             (newname "ARexx.guide.info")
  1368.             (noposition)
  1369.             (nogauge)
  1370.         )
  1371.         (copyfiles
  1372.             (prompt "Copying NewIcons icon files")
  1373.             (source "Thor_Install:NewIcons/THOR.guide.info")
  1374.             (dest "Thor:Docs")
  1375.             (newname "BBSReadRexx.guide.info")
  1376.             (noposition)
  1377.             (nogauge)
  1378.         )
  1379.         (copyfiles
  1380.             (prompt "Copying NewIcons icon files")
  1381.             (source "Thor_Install:NewIcons/THOR.guide.info")
  1382.             (dest "Thor:Docs")
  1383.             (newname "THOR_Rexx.guide.info")
  1384.             (noposition)
  1385.             (nogauge)
  1386.         )
  1387.         (copyfiles
  1388.             (prompt "Copying NewIcons icon files")
  1389.             (source "Thor_Install:NewIcons/THOR.guide.info")
  1390.             (dest "Thor:Docs")
  1391.             (newname "Installation.guide.info")
  1392.             (noposition)
  1393.             (nogauge)
  1394.         )
  1395.     )
  1396. )
  1397.  
  1398. (if (exists "env:sys/def_drawer.info" (noreq))
  1399.     (copyfiles
  1400.         (prompt "Copying default drawer icon")
  1401.         (help "This will copy the default drawer icon." newline @copyfiles-help)
  1402.         (source "env:sys/def_drawer.info")
  1403.         (dest "Thor:")
  1404.         (newname "Docs.info")
  1405.         (noposition)
  1406.         (infos)
  1407.     )
  1408. )
  1409.  
  1410. (if (exists "sys:classes/datatypes/exe.datatype" (noreq))
  1411.     (if (delete "sys:classes/datatypes/exe.datatype"
  1412.             (prompt #exedtbug)
  1413.             (help "The installer has found exe.datatype installed."
  1414.                     "Select YES if you want it delete it, otherwise NO")
  1415.             (optional "force" "askuser" "infos")
  1416.         )    
  1417.     )
  1418.     ; Then
  1419.     (
  1420.         (delete "devs:datatypes/exe" (infos))
  1421.     )
  1422. )
  1423.  
  1424. ;*****************************
  1425. ;* Simple configuration here *
  1426. ;*****************************
  1427.  
  1428. (if (= tcptype 1)
  1429.     ; then
  1430.     (
  1431.         (if    (askbool
  1432.                 (prompt newline "The following section in this installation "
  1433.                         "is used for setting up parameters needed "
  1434.                         "for use of the TCP types (POP3/NNTP/SMTP) "
  1435.                         "for Internet mail and news. This configuration is optional "
  1436.                         "but must be set later if you do not do this now.\n\n"
  1437.                         "Do you want to proceed with this?")
  1438.                 (help #installtext)
  1439.                 (default 1)
  1440.             )
  1441.             ; Then 
  1442.             (
  1443.                 (set DL_Dir 
  1444.                         (askdir
  1445.                             (prompt
  1446.                                 "Select default download directory."
  1447.                                 "This directory will be used for BBS message packets and "
  1448.                                 "downloads, SMTPd mailboxes and saving of MIME/uuencoded "
  1449.                                 "binaries. It can be changed in ConfigTHOR later on."
  1450.                             (help @askdir-help)
  1451.                             (default "Work:")
  1452.                             (newpath)
  1453.                         )
  1454.                     )
  1455.                 )
  1456.                 (set_dl_dir)
  1457.                 (create_inet_system)
  1458.                 (if    (askbool
  1459.                         (prompt newline 
  1460.                                 "If you like to set up some parameters like your "
  1461.                                 "real name, newsserver, mailserver etc. you can "
  1462.                                 "do this now. "
  1463.                                 "Do you want to proceed with this?")
  1464.                         (help #installtext)
  1465.                            (default 1)
  1466.                     )
  1467.                     ; Then 
  1468.                     (
  1469.                         (set typecfg (cat typecfg "THOR:bin/cfgtcp " quote systemname quote))
  1470.                         (set running (run typecfg))
  1471.                         (if    (askbool
  1472.                                 (prompt newline 
  1473.                                         "Would you like to order a list of available newsgroups "
  1474.                                         "from the configured newsserver for the next time you "
  1475.                                         "connect?")
  1476.                                 (help #installtext)
  1477.                                    (default 1)
  1478.                             )
  1479.                             ; Then 
  1480.                             (
  1481.                                 (set ConfigConf (cat '\nCONFIGCONF BBSNAME ' tick '"' systemname '"' tick ' CONFNAME ' tick '"EMail"' tick))
  1482.                                 (set ConfList (cat 'WRITEBREVENT BBSNAME ' tick '"' systemname '"' tick ' EVENT EVE_CONFLIST\n'))
  1483.                                 (set adrcmd (cat 'address command 'quote'Thor:bin/LoadBBSRead'quote'\n'))
  1484.                                 (textfile
  1485.                                     (dest 't:getconflist.rexx')
  1486.                                     (append '/* Order a list of newsgroups */\n\n')
  1487.                                     (append adrcmd)
  1488.                                     (append 'WaitForPort BBSREAD\n')
  1489.                                     (append 'address BBSREAD\n')
  1490.                                     (append '\nEVE_CONFLIST = 6\n')
  1491.                                     (append ConfList)
  1492.                                     (append (cat ConfigConf ' REPLYSTRING ' tick '"Hello %N, on %D, you said,"' tick ' SET c2x(CDF_MARK_OWN_MSGS)'))
  1493.                                     (append (cat ConfigConf ' SET c2x(CDF_ALWAYS_REPLY_STR)'))
  1494.                                     (append (cat ConfigConf ' CLEAR c2x(CDF_BBS_KEEPTIME)'))
  1495.                                     (append (cat ConfigConf ' CLEAR c2x(CDF_BBS_KEEPMSG)'))
  1496.                                     (append (cat ConfigConf ' SET c2x(CDF_IGNORE_KEEPTIME)'))
  1497.                                     (append (cat ConfigConf ' SET c2x(CDF_IGNORE_KEEPMSG)'))
  1498.                                     (append (cat ConfigConf ' SET c2x(CDF_MEMBER_OF)'))
  1499.                                     (append (cat ConfigConf ' SET c2x(CDF_MAIL)'))
  1500.                                     (append '\n')
  1501.                                 )
  1502.                                 (if (<> 0 (run 'rx t:getconflist.rexx'))
  1503.                                     (run 'sys:rexxc/rx t:getconflist.rexx')
  1504.                                 )
  1505.                             )
  1506.                         )
  1507.                         (message #endtcpcfgtext)
  1508.                     )
  1509.                 )
  1510.             )
  1511.         )
  1512.     )
  1513.     ; else
  1514.     (
  1515.         (if    (askbool
  1516.                 (prompt newline "The following section in this installation "
  1517.                             "is used for setting up a download and an upload "
  1518.                             "directory for message packets.  This section is "
  1519.                             "optional, but the directories needs to be "
  1520.                             "set in THOR if you do not set them up here.\n\n"
  1521.                             "Do you want to proceed with this?")
  1522.                 (help #installtext)
  1523.                 (default 1)
  1524.             )
  1525.             ; Then 
  1526.             (
  1527.                 (set DL_Dir 
  1528.                     (askdir
  1529.                         (prompt "Where do you keep your downloaded message packets?\n\n"
  1530.                                 "This is usually the download directory "
  1531.                                 "configured in the communication program you "
  1532.                                 "use."
  1533.                             (help @askdir-help)
  1534.                             (default "Work:")
  1535.                             (newpath)
  1536.                         )
  1537.                     )
  1538.                 )
  1539.                 (set_dl_dir)
  1540.     
  1541.                 (set UL_Dir 
  1542.                     (askdir
  1543.                         (prompt "Where would you like to keep any reply "
  1544.                                 "message packets that THOR generates?\n\n"
  1545.                                 "This is usually the upload directory "
  1546.                                 "configured in your communication program."
  1547.                             (help @askdir-help)
  1548.                             (default "Work:")
  1549.                             (newpath)
  1550.                         )
  1551.                     )
  1552.                 )
  1553.                 (set_ul_dir)
  1554.             )
  1555.         )
  1556.     )
  1557. )
  1558.  
  1559. ;*****************************
  1560. ;***** WE ARE ALMOST DONE ****
  1561. ;*****************************
  1562.  
  1563. ; make sure that default-dir is pointing to the right place
  1564. (set @default-dest Thor_Dir)
  1565.     
  1566. (makeassign "Thor_Install")
  1567. (makeassign "BBSData")
  1568. (makeassign "Thor_Disk" (safe))
  1569.  
  1570. (if (= dldirproblem 1)
  1571.     (message (cat "There was a problem configuring the download directory.\n\n"
  1572.         "Please configure this manually in THOR."))
  1573. )
  1574.  
  1575. ; final message for our viewers
  1576.     (set end_text (cat "Hope you like THOR! Don't hesitate to "
  1577.                     "send us comments, bugreports and suggestions."))
  1578.  
  1579. ; now for the exit
  1580.     (exit end_text)
  1581.  
  1582.